import React from "react";
import TextAtom from "../../Atoms/Text.Atom";
import TextAtomEnum from "../../Atoms/Text.Atom/enum";

interface HeadTableProps {
  headItems?: any;
  isLoading?: boolean;
}

const HeadTable: React.FC<HeadTableProps> = (props) => {
  const { headItems, isLoading } = props;

  return (
    <table className="w-full table-fixed">
      <thead>
        <tr>
          {headItems?.map((e: any, index: number) => (
            <td key={index} className={`${e.className}`}>
              <TextAtom
                isLoading={isLoading}
                className="font-bold"
                type={TextAtomEnum.enum_h4}
              >
                {e.title}
              </TextAtom>
            </td>
          ))}
        </tr>
      </thead>
    </table>
  );
};
export default React.memo(HeadTable);
